use "C:\Users\ibo6\OneDrive - The Pennsylvania State University\Working Papers\Target Hardening\v10 Terrorism and Political Violence\R & R\Analysis\rdyads2.dta", replace

* Table 5
** Model 11: Endogeneity  (police expenditure as % of state budget)
regress exp_perc soft_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology, robust cluster(dyadid)
estimates store t4_endo_policeexp
** Model 12: Endogeneity (training expenditure per 10000 police officer)
regress train_exp_per soft_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology, robust cluster(dyadid)
estimates store t4_endo_trainexp

ssc install estout
label variable soft_l "Ratio of attacks against soft targets (lagged)"
label variable a_l "Success rate against hard targets (lagged)"
label variable suictot_l "Ratio of suicide attacks (lagged)"
label variable coin_deaths_log_l "COIN casualties (lagged)"
label variable inten "Conflict intensity"
label variable epr "Ethnic fractionalization"
label variable ideology "Group ideology"
label define ideology 1 "Ethnonationalist" 2 "Religious" 3 "Leftist" 4 "Other"
label values ideology ideology

esttab t4_endo_policeexp t4_endo_trainexp using table5.csv, b(%5.3f)  mlabel("Police Expenditure" "Training Expenditure") se starlevels(* 0.1 ** 0.05 *** 0.01) label noconstant nobaselevels title("OLS Models of Police and Training Expenditures in Relevant State-Group Dyads in India, 2004-2016") addnotes("The dependent variables are the police expenditure as percentage of state budget (Model 13) and training expenditure per 10000 police officer (Model 14) in a given relevant state-group dyad in a given year. Robust standard errors clustered on relevant state-group dyads are presented in parentheses.")